<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@include file="../base.jsp" %> 
<sys:genericTag4o 
    id="logTypeDtoList"
    methodName="queryLogTypeList" 
    className="com.tmpt.controller.taglib.OperationlogTag"/>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>日志查询</title>    
<link href="../css/main.css" rel="stylesheet" type="text/css" >
<link rel="stylesheet" type="text/css" href="../../js/jquery/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../../js/jquery/easyui/themes/icon.css">
<script type="text/javascript" src="../../js/jquery-1.8.0.min.js"></script>
<script src="../../js/jquery/easyui/jquery.easyui.min.js"></script>
<script src="../../js/jquery/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../../js/jquery.select.js"></script>
<script type="text/javascript">
var datagrid={
    datagridId:"logList",
    datagridUrl:"logListAjax_queryOperationlogBySearch.action",
    datagridObj:{
        nowrap:true,
        autoRowHeight:false,
        fit:true,
        columns:[
            [
                {field:'loginName',title:'登录名',width:100},
                {field:'name',title:'姓名',width:100},
                {field:'loginIp',title:'登录Ip',width:100},
                {field:'createDateStr',title:'录入时间',width:125},
                {field:'orderTypeStr',title:'订单类型',width:100},
                {field:'orderNum',title:'订单号',width:125},
                {field:'logTypeName',title:'操作类型',width:100},
                {field:'description',title:'操作内容',width:400},
            ]
        ],
        rownumbers:true,
		frozenColumns:[[
		                {field:'cb',checkbox:true}
		]],
        toolbar:[
                 {
                     id:'queryOrderDetail',
					 text:'查看明细',
					 iconCls:'icon-search',
					 handler:function(){
                	 	showAll();
					 }
                  },"-",
                  {
                     id:'queryOrderDetail',
 					 text:'下载报表',
					 iconCls:'icon-print',
 					 handler:function(){
                	 	downloadReport();
 					 }
                   }
        ]
    },
    datagridProperty:{
        recordDateStart:'录入日期(起)',
        recordDateEnd:'录入日期(止)'
    },
    datagridPropertySort:{
    	opLogId:'默认属性',
    	createDate:'录入日期'
    }/*,
    datagridPropertyMultiQuery:{
    }*/
};

function showAll(){
	var rows = $('#logList').datagrid('getSelections');
	if(rows.length!=1){
		alert('只能选择一项进行操作');
		return false;
	}
	Open_Dialog(rows);
}

function Open_Dialog(rows) { 
	var orderId = rows[0].id;
	var description = rows[0].description;
	$('#description').val(description);
	
	$('#mydialog').show(); 
	$('#mydialog').dialog({ 
		modal:true, 
		buttons: [{ 
			text: '关闭', 
			iconCls: 'icon-cancel', 
			handler: function() { 
				$('#mydialog').dialog("close");
			} 
		}] 
	}); 
} 

function downloadReport(){
	document.downloadReportForm.submit();
}
</script>

<style type="text/css">
	.west{
		width: 200px;
		padding: 3px;
	}
	.center{
		padding: 3px;
	}
</style>
</head>

<body class="easyui-layout" style="margin: 2px;">
	<div region="west" class="west" title="条件搜索">
        <jsp:include page="../condition.jsp"></jsp:include>
	</div>
	<div region="center" class="center" title="查询列表">
         <table id="logList" width="100%" ></table>
		<s:form 
			id="downloadReportForm" 
			name="downloadReportForm" 
			action="logList_downloadReportLogList.action" 
			namespace="/admin123/order" 
			theme="simple"
			target="_blank"/>
		<div id="mydialog" style="display:none;padding:10px;width:450px;height:200px;" title="查询明细"> 
			<br/>
			操作内容：
			<textarea rows="4" cols="54" id="description"></textarea>
		</div>
	</div>
</body>	
</html>